//
//  QLYDHTTPSessionManager.m
//  QLYDNetWork
//
//  Created by fb on 2020/12/4.
//

#import "QLYDHTTPSessionManager.h"
@implementation QLYDHTTPSessionManager
+ (instancetype)shareSessionManager {
    
    static QLYDHTTPSessionManager *manager;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
        manager = [[QLYDHTTPSessionManager alloc]initWithSessionConfiguration:configuration];
        [manager initConfig];
    });
    return  manager;
    
}
- (void)initConfig{
    //request
    self.requestSerializer = [AFJSONRequestSerializer serializer];
    self.securityPolicy.allowInvalidCertificates = YES;
    self.securityPolicy.validatesDomainName = NO;
    self.requestSerializer.timeoutInterval = 10.f;
    //reponse
    self.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json",@"text/html", @"text/json", @"text/javascript",@"text/plain", nil];

}


@end
